package com.rst.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name="t_students")
public class Student {

	public static final int ACTIVE = 1;
	public static final int INACTIVE = 0;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="f_student_id")
	private Long id;	
	
	@Column(name="f_user_id")	
	private String userId;
	
	@Column(name="f_admission_no")
	private Long admissionNo;
	
	@Column(name="f_class_roll_no")	
	private Long classRollNo;
	
	@Column(name="f_admission_date")	
	private Date admissionDate;
	
	@Column(name="f_section_id")	
	private Long sectionId;
	
	@Column(name="f_student_category_id")
	private Long studentCategoryId;
	
	@Column(name="f_status")
	private Integer status;
	
	@Column(name="f_created_at")
	private Date createdAt;
	
	@Column(name="f_updated_at")
	private Date updatedAt;	
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_section_id", nullable=false, insertable=false, updatable=false)
	private Section section;

	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_student_category_id", nullable=false, insertable=false, updatable=false)
	private StudentCategory studentCategory;

	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_user_id", nullable=false, insertable=false, updatable=false)
	private UserDetailsDTO userDetails ;
	
	@OneToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="f_student_id", nullable=false, insertable=false, updatable=false)
	private Attendance attendance  ;

	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public Long getAdmissionNo() {
		return admissionNo;
	}
	public void setAdmissionNo(Long admissionNo) {
		this.admissionNo = admissionNo;
	}
	public Long getClassRollNo() {
		return classRollNo;
	}
	public void setClassRollNo(Long classRollNo) {
		this.classRollNo = classRollNo;
	}
	public Long getSectionId() {
		return sectionId;
	}
	public void setSectionId(Long sectionId) {
		this.sectionId = sectionId;
	}
	public Date getAdmissionDate() {
		return admissionDate;
	}
	public void setAdmissionDate(Date admissionDate) {
		this.admissionDate = admissionDate;
	}
	public Long getStudentCategoryId() {
		return studentCategoryId;
	}
	public void setStudentCategoryId(Long studentCategoryId) {
		this.studentCategoryId = studentCategoryId;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Date getCreatedAt() {
		return createdAt;
	}
	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}
	public Date getUpdatedAt() {
		return updatedAt;
	}
	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}
	public Section getSections() {
		return section;
	}
	public void setSections(Section section) {
		this.section = section;
	}
	public StudentCategory getStudentCategory() {
		return studentCategory;
	}
	public void setStudentCategory(StudentCategory studentCategory) {
		this.studentCategory = studentCategory;
	}
	public Section getSection() {
		return section;
	}
	public void setSection(Section section) {
		this.section = section;
	}
	public UserDetailsDTO getUserDetails() {
		return userDetails;
	}
	public void setUserDetails(UserDetailsDTO userDetails) {
		this.userDetails = userDetails;
	}
	public Attendance getAttendance() {
		return attendance;
	}
	public void setAttendance(Attendance attendance) {
		this.attendance = attendance;
	}

	
}
